﻿using Shop.Data.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.Data.Mapping
{
    public class ClienteMapping : EntityTypeConfiguration<Cliente>
    {
         public ClienteMapping()
        {
            ToTable("Clientes");

            HasKey(t => t.Id);
            Property(t=> t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            Property(t => t.codigo).IsRequired();
            Property(t => t.nombre).IsOptional();
            Property(t => t.apellidopaterno).IsOptional();
            Property(t => t.apellidomaterno).IsOptional();
            Property(t => t.ruc).IsOptional();
            Property(t => t.ciudad).IsOptional();
            Property(t => t.direccion).IsOptional();
            Property(t => t.celular).IsOptional();
        }
    }
}

